<?php
/**********************************************************
  eCode Marketing System
  Version 0.1
  System Configuration (/config.php)
**********************************************************/

/* Check to see if we're being called from another script.
   Stop execution if we aren't. */
if(!defined("FROMSCRIPT")) die("File not directly accessible.");

/* Site configuration */
define("SITE_NAME", "eCode Marketing System");
define("OFFER_CODE", "eCode Offer Code");
define("ORGANIZATION", "Glenmere Industries");
define("TEMPLATE", "excalibur");

/* Directory configuration */
define("ADMIN_DIR", dirname(__FILE__)."/admin");
define("CACHE_DIR", dirname(__FILE__)."/cache");
define("INCLUDES_DIR", dirname(__FILE__)."/include");
define("TEMPLATES_DIR", dirname(__FILE__)."/templates");

define("TEMPLATE_DIR", TEMPLATES_DIR . "/" . TEMPLATE);
define("TEMPLATE_DIR_EXT", str_replace(dirname(__FILE__), "" , TEMPLATE_DIR));
define("INCLUDES_DIR_EXT", str_replace(dirname(__FILE__), "", INCLUDES_DIR));

define("WEBSITE_HEADER", "<a href=\"/\"><img src=\"/images/logo.png\" alt=\"" . SITE_NAME . "\" /></a>");
define("WEBSITE_FOOTER", "<p>&copy; [YEAR] " . ORGANIZATION . "</p>");

/* Database configuration */
define("DB_HOST", "localhost");
define("DB_DATABASE", "ecms");
define("DB_USERNAME", "ecms");
define("DB_PASSWORD", "3cm5");
define("DB_TBL_PREFIX", "ecms_");

/* Coupon generator configuration */

/* Base image filename (relative to document root), width, and height. */

$coupon['base_image']['filename'] = $_SERVER['DOCUMENT_ROOT']."/images/basecoupon.png";
$coupon['base_image']['width'] = 300;
$coupon['base_image']['height'] = 450;

/* Coupon offer text font size, font face, and y-position. */

$coupon['offer_line1']['font'] = INCLUDES_DIR . "/arial.ttf";
$coupon['offer_line1']['size'] = 14;
$coupon['offer_line1']['ypos'] = 90;

$coupon['offer_line2']['font'] = INCLUDES_DIR . "/arial.ttf";
$coupon['offer_line2']['size'] = 14;
$coupon['offer_line2']['ypos'] = 120;

$coupon['offer_line3']['font'] = INCLUDES_DIR . "/arial.ttf";
$coupon['offer_line3']['size'] = 14;
$coupon['offer_line3']['ypos'] = 150;

/* Offer price and value text font sizes, font faces, and y-positions. */

$coupon['offer_price']['font'] = INCLUDES_DIR . "/arialbd.ttf";
$coupon['offer_price']['size'] = 40;
$coupon['offer_price']['ypos'] = 210;

$coupon['offer_value']['font'] = INCLUDES_DIR . "/arialbd.ttf";
$coupon['offer_value']['size'] = 14;
$coupon['offer_value']['ypos'] = 240;

/* Define coupon POS code text font size, font face, and y-position. */

$coupon['offer_pos_code']['font'] = INCLUDES_DIR . "/arialbd.ttf";
$coupon['offer_pos_code']['size'] = 9;
$coupon['offer_pos_code']['ypos'] = 370;

/* Define coupon expiry date text font size, font face, and y-position. */

$coupon['offer_end_date']['font'] = INCLUDES_DIR . "/arialbd.ttf";
$coupon['offer_end_date']['size'] = 9;
$coupon['offer_end_date']['ypos'] = 280;

require_once(INCLUDES_DIR . "/ez_sql_core.php");
require_once(INCLUDES_DIR . "/ez_sql_mysql.php");
$db = new ezSQL_mysql(DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_HOST);
?>